package com.xuelang.pipeline.domain.pipeline.service.imp;

import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.pipeline.dto.PipelineInstanceQuery;
import com.xuelang.pipeline.domain.pipeline.PipelineInstance;
import com.xuelang.pipeline.domain.pipeline.repository.PipelineInstanceRepository;
import com.xuelang.pipeline.domain.pipeline.service.PipelineInstanceDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>流水线实例域服务接口实现类</p>
 *
 * @author : yixin.lys
 * @date : 2024-06-19 09:39
 **/
@Service
public class PipelineInstanceDomainServiceImpl implements PipelineInstanceDomainService {

    @Autowired
    private PipelineInstanceRepository repository;

    @Override
    public PageRecord<PipelineInstance> pageByPipelineCode(long currentPage, long pageSize, PipelineInstanceQuery pipelineInstanceQuery) {
        return repository.pageByPipelineCode(currentPage, pageSize, pipelineInstanceQuery);
    }

    @Override
    public PipelineInstance queryByCode(String pipelineInstanceCode) {
        return repository.queryByCode(pipelineInstanceCode);
    }

    @Override
    public List<PipelineInstance> listByQuery(PipelineInstanceQuery pipelineInstanceQuery) {
        return repository.listByQuery(pipelineInstanceQuery);
    }

    @Override
    public void add(PipelineInstance pipelineInstance) {
        repository.add(pipelineInstance);
    }

    @Override
    public void update(PipelineInstance pipelineInstance) {
        repository.update(pipelineInstance);
    }

    @Override
    public void removeByIds(List<String> idList) {
        repository.removeByIds(idList);
    }

    @Override
    public void removeByCodes(List<String> codeList) {
        repository.removeByCodes(codeList);
    }
}
